package net.sky.oa.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Type;

/**
 * 新增回帖表
 * REPLIES_ADD. @author ...
 */
@Entity
@Table(name = "REPLIES_ADD")//公告评论表
public class ReplyAdd implements Serializable{
	private static final long serialVersionUID = 762383763562279957L;
	
	// Fields
	/**ID*/
	protected Long repId;  
	/**回帖内容*/
	private String repContent;  
	/**回帖时间*/
	private Date repReplytime = new Date();	
	/**状态 是否匿名 1不匿名 2匿名*/
	private Integer repStatus;  
	/**回帖部门名称*/
	private String repDeptname; 
	/**回帖人ID*/
	private Integer userId;  
	/**对应公告*/
	private Integer repNoticeId;
	
	@Id
    @Column(name = "rep_id", unique = true, nullable = false)
	@SequenceGenerator(name="SQ_REPLIESADD_ID",sequenceName="SQ_REPLIESADD_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_REPLIESADD_ID")
	public Long getRepId() {
		return repId;
	}
	public void setRepId(Long repId) {
		this.repId = repId;
	}
	
	@Lob
    @Basic(fetch = FetchType.EAGER)
    @Column(name = "rep_content", columnDefinition = "CLOB", nullable = true)
    @Type(type ="org.springframework.orm.hibernate3.support.ClobStringType")
	public String getRepContent() {
		return repContent;
	}
	public void setRepContent(String repContent) {
		this.repContent = repContent;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "rep_replytime")
	public Date getRepReplytime() {
		return repReplytime;
	}
	public void setRepReplytime(Date repReplytime) {
		this.repReplytime = repReplytime;
	}
	@Column(name = "rep_status", precision = 2, scale = 0)
	public Integer getRepStatus() {
		return repStatus;
	}
	public void setRepStatus(Integer repStatus) {
		this.repStatus = repStatus;
	}
	@Column(name = "rep_deptname", length = 100)
	public String getRepDeptname() {
		return repDeptname;
	}
	public void setRepDeptname(String repDeptname) {
		this.repDeptname = repDeptname;
	}
	@Column(name = "rep_user_id")
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	@Column(name = "rep_notice_id")
	public Integer getRepNoticeId() {
		return repNoticeId;
	}
	public void setRepNoticeId(Integer repNoticeId) {
		this.repNoticeId = repNoticeId;
	}
	
	
//	@ManyToOne(fetch = FetchType.EAGER)
//	@JoinColumn(name = "rep_user_id")
//	public SysEmployee getUsers() {
//		return users;
//	}
//	public void setUsers(SysEmployee users) {
//		this.users = users;
//	}
//	
//	@ManyToOne(fetch = FetchType.LAZY)
//	@JoinColumn(name = "rep_notice_id")
//	public InfBulletin getInfbulletin() {
//		return infbulletin;
//	}
//	public void setInfbulletin(InfBulletin infbulletin) {
//		this.infbulletin = infbulletin;
//	}
	
}
